trigger SummaryStepChanged on Case ( after update) {

    //Case thisCase = Trigger.new;

    Map<ID,Case> oldCase = Trigger.oldMap;
    list<Summary_Steps__c> SummarySteps = new list<Summary_Steps__c>();
    
    for(case cs: Trigger.new)
    {
        Summary_Steps__c newSummaryStep = new Summary_Steps__c();    
        if(cs.Summary_Step__c != oldCase.get(cs.Id).Summary_Step__c && oldCase.get(cs.Id).Summary_Step__c != NULL){
            newSummaryStep.Case_Number__c = cs.Id;
            newSummaryStep.User_Name__c = UserInfo.getName();
            newSummaryStep.Summary_Step__c = oldCase.get(cs.Id).Summary_Step__c;
            newSummaryStep.Resolution_Letter_Status__c = oldCase.get(cs.Id).Resolution_Letter_Status__c;
            newSummaryStep.DateTime__c = System.NOW();
            SummarySteps.add(newSummaryStep);
            //oldCase.get(cs.Id).Resolved_By__c = UserInfo.getUserId();
            //oldCase.get(cs.Id).Owner_Name__c = UserInfo.getName();
            
            
        }
//        thisCase = cs;
       
    }
    
    if( SummarySteps.size() > 0 ) {
        insert SummarySteps;
//       thisCase.Resolved_By__c = UserInfo.getUserId();
//        update thisCase;
    }
}